<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>WiFi Logger component: include/wifi_logger.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">WiFi Logger component
   &#160;<span id="projectnumber">1.0</span>
   </div>
   <div id="projectbrief">WiFi Logger component, uses wifi to output logs</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">wifi_logger.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="wifi__logger_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#ifndef WIFI_LOGGER_H</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#define WIFI_LOGGER_H</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;</div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="tcp__handler_8h.html">tcp_handler.h</a>&quot;</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="udp__handler_8h.html">udp_handler.h</a>&quot;</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="websocket__handler_8h.html">websocket_handler.h</a>&quot;</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="utils_8h.html">utils.h</a>&quot;</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor">#include &quot;freertos/FreeRTOS.h&quot;</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor">#include &quot;freertos/task.h&quot;</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor">#include &quot;esp_system.h&quot;</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor">#include &quot;freertos/queue.h&quot;</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;</div><div class="line"><a name="l00013"></a><span class="lineno"><a class="line" href="wifi__logger_8h.html#afde8dfae74b6444a5a97ef478d33eb6e">   13</a></span>&#160;QueueHandle_t <a class="code" href="wifi__logger_8h.html#afde8dfae74b6444a5a97ef478d33eb6e">wifi_logger_queue</a>;</div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;</div><div class="line"><a name="l00015"></a><span class="lineno"><a class="line" href="wifi__logger_8h.html#a81a6fc89c7bc286cb7360b155b1901bf">   15</a></span>&#160;<span class="preprocessor">#define MESSAGE_QUEUE_SIZE CONFIG_MESSAGE_QUEUE_SIZE</span></div><div class="line"><a name="l00016"></a><span class="lineno"><a class="line" href="wifi__logger_8h.html#a6b20d41d6252e9871430c242cb1a56e7">   16</a></span>&#160;<span class="preprocessor">#define BUFFER_SIZE CONFIG_BUFFER_SIZE</span></div><div class="line"><a name="l00017"></a><span class="lineno"><a class="line" href="wifi__logger_8h.html#a6423a880df59733d2d9b509c7718d3a9">   17</a></span>&#160;<span class="preprocessor">#define STACK_SIZE CONFIG_MESSAGE_QUEUE_SIZE*8</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;</div><div class="line"><a name="l00019"></a><span class="lineno"><a class="line" href="wifi__logger_8h.html#a6b6749d2bc61d3531ce162697a3b6763">   19</a></span>&#160;<span class="preprocessor">#define wifi_log_e(TAG, fmt, ...) generate_log_message(ESP_LOG_ERROR, TAG, __LINE__, __func__, fmt, __VA_ARGS__);</span></div><div class="line"><a name="l00020"></a><span class="lineno"><a class="line" href="wifi__logger_8h.html#a65a22fcabade45df96f114d9cd65c624">   20</a></span>&#160;<span class="preprocessor">#define wifi_log_w(TAG, fmt, ...) generate_log_message(ESP_LOG_WARN, TAG, __LINE__, __func__, fmt, __VA_ARGS__);</span></div><div class="line"><a name="l00021"></a><span class="lineno"><a class="line" href="wifi__logger_8h.html#ada0d40ce433f04464af831b604e43921">   21</a></span>&#160;<span class="preprocessor">#define wifi_log_i(TAG, fmt, ...) generate_log_message(ESP_LOG_INFO, TAG, __LINE__, __func__, fmt, __VA_ARGS__);</span></div><div class="line"><a name="l00022"></a><span class="lineno"><a class="line" href="wifi__logger_8h.html#afbae087a7bf7b57f8799793b924b0805">   22</a></span>&#160;<span class="preprocessor">#define wifi_log_d(TAG, fmt, ...) generate_log_message(ESP_LOG_DEBUG, TAG, __LINE__, __func__, fmt, __VA_ARGS__);</span></div><div class="line"><a name="l00023"></a><span class="lineno"><a class="line" href="wifi__logger_8h.html#abd42fb07f8ce89fa9b65dfb3e58c5cee">   23</a></span>&#160;<span class="preprocessor">#define wifi_log_v(TAG, fmt, ...) generate_log_message(ESP_LOG_VERBOSE, TAG, __LINE__, __func__, fmt, __VA_ARGS__);</span></div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;</div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;esp_err_t <a class="code" href="wifi__logger_8h.html#a320afeaba56579760e7e3185a3d1fa02">init_queue</a>(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="keywordtype">void</span> <a class="code" href="wifi__logger_8h.html#aea5e8c4231b83bde5f8f0f4556271aba">init_wifi</a>(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;esp_err_t <a class="code" href="wifi__logger_8h.html#a2261c877b2e047a36b7df77259b689ec">send_to_queue</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* log_message);</div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="keywordtype">char</span>* <a class="code" href="wifi__logger_8h.html#ad28af408449f666a77441f0120a6a228">receive_from_queue</a>(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="keywordtype">void</span> <a class="code" href="wifi__logger_8h.html#a607f3b56f74b73ea4eb34e7ffeba1e82">generate_log_message</a>(esp_log_level_t level, <span class="keyword">const</span> <span class="keywordtype">char</span> *TAG, <span class="keywordtype">int</span> line, <span class="keyword">const</span> <span class="keywordtype">char</span> *func, <span class="keyword">const</span> <span class="keywordtype">char</span> *fmt, ...);</div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="keywordtype">void</span> <a class="code" href="wifi__logger_8h.html#a8e612786031d82bb0eac8affe469ed2c">start_wifi_logger</a>(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="keywordtype">void</span> <a class="code" href="wifi__logger_8h.html#a5933039bf48c5286eb41c1268ee8021b">wifi_logger</a>();</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;</div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;</div><div class="ttc" id="udp__handler_8h_html"><div class="ttname"><a href="udp__handler_8h.html">udp_handler.h</a></div></div>
<div class="ttc" id="wifi__logger_8h_html_a5933039bf48c5286eb41c1268ee8021b"><div class="ttname"><a href="wifi__logger_8h.html#a5933039bf48c5286eb41c1268ee8021b">wifi_logger</a></div><div class="ttdeci">void wifi_logger()</div></div>
<div class="ttc" id="wifi__logger_8h_html_a2261c877b2e047a36b7df77259b689ec"><div class="ttname"><a href="wifi__logger_8h.html#a2261c877b2e047a36b7df77259b689ec">send_to_queue</a></div><div class="ttdeci">esp_err_t send_to_queue(const char *log_message)</div><div class="ttdoc">Sends log message to message queue. </div><div class="ttdef"><b>Definition:</b> wifi_logger.c:44</div></div>
<div class="ttc" id="wifi__logger_8h_html_afde8dfae74b6444a5a97ef478d33eb6e"><div class="ttname"><a href="wifi__logger_8h.html#afde8dfae74b6444a5a97ef478d33eb6e">wifi_logger_queue</a></div><div class="ttdeci">QueueHandle_t wifi_logger_queue</div><div class="ttdef"><b>Definition:</b> wifi_logger.h:13</div></div>
<div class="ttc" id="wifi__logger_8h_html_a8e612786031d82bb0eac8affe469ed2c"><div class="ttname"><a href="wifi__logger_8h.html#a8e612786031d82bb0eac8affe469ed2c">start_wifi_logger</a></div><div class="ttdeci">void start_wifi_logger(void)</div><div class="ttdoc">wrapper function to start wifi logger </div><div class="ttdef"><b>Definition:</b> wifi_logger.c:152</div></div>
<div class="ttc" id="wifi__logger_8h_html_ad28af408449f666a77441f0120a6a228"><div class="ttname"><a href="wifi__logger_8h.html#ad28af408449f666a77441f0120a6a228">receive_from_queue</a></div><div class="ttdeci">char * receive_from_queue(void)</div><div class="ttdoc">Receive data from queue. </div><div class="ttdef"><b>Definition:</b> wifi_logger.c:70</div></div>
<div class="ttc" id="utils_8h_html"><div class="ttname"><a href="utils_8h.html">utils.h</a></div></div>
<div class="ttc" id="tcp__handler_8h_html"><div class="ttname"><a href="tcp__handler_8h.html">tcp_handler.h</a></div></div>
<div class="ttc" id="wifi__logger_8h_html_a320afeaba56579760e7e3185a3d1fa02"><div class="ttname"><a href="wifi__logger_8h.html#a320afeaba56579760e7e3185a3d1fa02">init_queue</a></div><div class="ttdeci">esp_err_t init_queue(void)</div><div class="ttdoc">Initialises message queue. </div><div class="ttdef"><b>Definition:</b> wifi_logger.c:10</div></div>
<div class="ttc" id="wifi__logger_8h_html_aea5e8c4231b83bde5f8f0f4556271aba"><div class="ttname"><a href="wifi__logger_8h.html#aea5e8c4231b83bde5f8f0f4556271aba">init_wifi</a></div><div class="ttdeci">void init_wifi(void)</div><div class="ttdoc">Initialises and connects to wifi. </div><div class="ttdef"><b>Definition:</b> wifi_logger.c:29</div></div>
<div class="ttc" id="websocket__handler_8h_html"><div class="ttname"><a href="websocket__handler_8h.html">websocket_handler.h</a></div></div>
<div class="ttc" id="wifi__logger_8h_html_a607f3b56f74b73ea4eb34e7ffeba1e82"><div class="ttname"><a href="wifi__logger_8h.html#a607f3b56f74b73ea4eb34e7ffeba1e82">generate_log_message</a></div><div class="ttdeci">void generate_log_message(esp_log_level_t level, const char *TAG, int line, const char *func, const char *fmt,...)</div><div class="ttdoc">generates log message, of the format generated by ESP_LOG function </div><div class="ttdef"><b>Definition:</b> wifi_logger.c:108</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
